/*
 * <p>Copyright® 2009-2022 东软 IT 实训中心版权所有。</p>
 */

package com.max.back.doctor.api;

import com.max.back.common.http.ResponseResult;
import com.max.back.doctor.form.PatientHistoryForm;
import com.max.back.doctor.form.groups.CreateAndGetExaminationId;
import com.max.back.doctor.service.ExaminationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@Deprecated
@CrossOrigin
@RestController
@RequestMapping("/doctor/examination")
public class ExaminationApi {

    @Autowired
    private ExaminationService examinationService;

    @PostMapping("/createAndGetExaminationId")
    public ResponseResult<String> createAndGetExaminationId(
            @RequestBody
            @Validated(CreateAndGetExaminationId.class) PatientHistoryForm form){
        return  ResponseResult.getSuccessResult(
                examinationService.createAndGetExaminationId(form.getPatientHistoryId()));
    }

    @GetMapping("/createAndGetExaminationId2")
    public ResponseResult<String> createAndGetExaminationId2(String patientHistoryId){
        return  ResponseResult.getSuccessResult(
                examinationService.createAndGetExaminationId(patientHistoryId));
    }
}
